<html>
<head>
    <title>To-Do lists</title>
</head>
<body>
<h1>{% block header_text %}{% endblock %}</h1>
<div class="navbar">
    {% if user.is_authenticated %}
        <p>Logged in as {{ user.email }}</p>
        <p><a href="{% url 'logout' %}">Log out</a></p>
    {% else %}
        <form method="POST" action="{% url 'send_login_email' %}">
            {% csrf_token %}
            Enter email to log in: <input type="text" name="email">
            <input type="submit" value="发送">
        </form>
    {% endif %}
</div>
<form method="POST" action="{% block form_action %}{% endblock %}">
    {% csrf_token %}
    {{ form.text }}

    {% if form.errors %}
    <div class="has-error">
        <span>{{ form.text.errors }}</span>
    </div>
    {% endif %}
</form>

{% block table %}{% endblock %}
</body>
</html>
